package com.springboot.test.web.common;

import com.springboot.test.common.response.Response;
import com.springboot.test.service.FileUploadService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@RequestMapping("app/upload")
public class FileUploadController {

    @Resource
    private FileUploadService fileUploadService;

    @PostMapping("oss")
    public Response<String> fileUpload(MultipartFile file){
        return Response.success(fileUploadService.fileUpload(file));
    }
}
